.class Lcom/brixd/niceapp/community/activity/AuthActivity$3;
.super Ljava/lang/Object;
.source "AuthActivity.java"

# interfaces
.implements Landroid/view/View$OnClickListener;


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/brixd/niceapp/community/activity/AuthActivity;->initWidgetsActions()V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation


# instance fields
.field final synthetic this$0:Lcom/brixd/niceapp/community/activity/AuthActivity;


# direct methods
.method constructor <init>(Lcom/brixd/niceapp/community/activity/AuthActivity;)V
    .registers 2
    .param p1, "this$0"    # Lcom/brixd/niceapp/community/activity/AuthActivity;

    .prologue
    .line 94
    iput-object p1, p0, Lcom/brixd/niceapp/community/activity/AuthActivity$3;->this$0:Lcom/brixd/niceapp/community/activity/AuthActivity;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


# virtual methods
.method public onClick(Landroid/view/View;)V
    .registers 14
    .param p1, "v"    # Landroid/view/View;

    .prologue
    .line 98
    iget-object v0, p0, Lcom/brixd/niceapp/community/activity/AuthActivity$3;->this$0:Lcom/brixd/niceapp/community/activity/AuthActivity;

    # getter for: Lcom/brixd/niceapp/community/activity/AuthActivity;->mAuthCodeEdt:Landroid/widget/EditText;
    invoke-static {v0}, Lcom/brixd/niceapp/community/activity/AuthActivity;->access$100(Lcom/brixd/niceapp/community/activity/AuthActivity;)Landroid/widget/EditText;

    move-result-object v0

    invoke-virtual {v0}, Landroid/widget/EditText;->getText()Landroid/text/Editable;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/String;->trim()Ljava/lang/String;

    move-result-object v2

    .line 99
    .local v2, "code":Ljava/lang/String;
    invoke-static {v2}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v0

    if-eqz v0, :cond_1f

    .line 100
    const v0, 0x7f0c00d7

    invoke-static {v0}, Lcom/brixd/niceapp/util/ToastUtils;->show(I)V

    .line 150
    :goto_1e
    return-void

    .line 104
    :cond_1f
    invoke-static {}, Lcom/brixd/niceapp/service/UserService;->getLoginUser()Lcom/brixd/niceapp/model/UserModel;

    move-result-object v11

    .line 105
    .local v11, "userModel":Lcom/brixd/niceapp/model/UserModel;
    invoke-virtual {v11}, Lcom/brixd/niceapp/model/UserModel;->getUid()I

    move-result v0

    invoke-static {v0}, Lcom/brixd/niceapp/util/SecrUtils;->makeToken(I)Lcom/brixd/niceapp/model/Token;

    move-result-object v9

    .line 106
    .local v9, "token":Lcom/brixd/niceapp/model/Token;
    new-instance v10, Lorg/json/JSONObject;

    invoke-direct {v10}, Lorg/json/JSONObject;-><init>()V

    .line 109
    .local v10, "userJson":Lorg/json/JSONObject;
    :try_start_30
    const-string v0, "weibo_uid"

    invoke-virtual {v11}, Lcom/brixd/niceapp/model/UserModel;->getWeiboUid()J

    move-result-wide v4

    invoke-virtual {v10, v0, v4, v5}, Lorg/json/JSONObject;->put(Ljava/lang/String;J)Lorg/json/JSONObject;

    .line 110
    const-string v0, "uid"

    invoke-virtual {v11}, Lcom/brixd/niceapp/model/UserModel;->getUid()I

    move-result v1

    invoke-virtual {v10, v0, v1}, Lorg/json/JSONObject;->put(Ljava/lang/String;I)Lorg/json/JSONObject;

    .line 111
    const-string v0, "name"

    invoke-virtual {v11}, Lcom/brixd/niceapp/model/UserModel;->getName()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v10, v0, v1}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    .line 112
    const-string v0, "image"

    invoke-virtual {v11}, Lcom/brixd/niceapp/model/UserModel;->getImage()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v10, v0, v1}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    .line 113
    const-string v0, "nick"

    invoke-virtual {v11}, Lcom/brixd/niceapp/model/UserModel;->getNick()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v10, v0, v1}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
    :try_end_5d
    .catch Lorg/json/JSONException; {:try_start_30 .. :try_end_5d} :catch_7c

    .line 118
    :goto_5d
    iget-object v0, p0, Lcom/brixd/niceapp/community/activity/AuthActivity$3;->this$0:Lcom/brixd/niceapp/community/activity/AuthActivity;

    # getter for: Lcom/brixd/niceapp/community/activity/AuthActivity;->mRequest:Lcom/brixd/niceapp/service/restful/NiceAppRestfulRequest;
    invoke-static {v0}, Lcom/brixd/niceapp/community/activity/AuthActivity;->access$300(Lcom/brixd/niceapp/community/activity/AuthActivity;)Lcom/brixd/niceapp/service/restful/NiceAppRestfulRequest;

    move-result-object v0

    invoke-virtual {v10}, Lorg/json/JSONObject;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v11}, Lcom/brixd/niceapp/model/UserModel;->getUid()I

    move-result v3

    invoke-virtual {v9}, Lcom/brixd/niceapp/model/Token;->getTimestamp()J

    move-result-wide v4

    invoke-virtual {v9}, Lcom/brixd/niceapp/model/Token;->getSecr()Ljava/lang/String;

    move-result-object v6

    new-instance v7, Lcom/brixd/niceapp/community/activity/AuthActivity$3$1;

    invoke-direct {v7, p0}, Lcom/brixd/niceapp/community/activity/AuthActivity$3$1;-><init>(Lcom/brixd/niceapp/community/activity/AuthActivity$3;)V

    invoke-interface/range {v0 .. v7}, Lcom/brixd/niceapp/service/restful/NiceAppRestfulRequest;->grant(Ljava/lang/String;Ljava/lang/String;IJLjava/lang/String;Lretrofit/Callback;)V

    goto :goto_1e

    .line 114
    :catch_7c
    move-exception v8

    .line 115
    .local v8, "e":Lorg/json/JSONException;
    invoke-virtual {v8}, Lorg/json/JSONException;->printStackTrace()V

    goto :goto_5d
.end method
